package com.example.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController // = @Controller + @ResponseBody
public class StudentController {

    // 1、得到日志对象
    private static final Logger logger = LoggerFactory.getLogger(StudentController.class);

    @RequestMapping("/stu/sayhi")
    public String sayhi() {
        logger.info("student info");
        logger.error("student error");
        return "student say hi";
    }
}
